package com.yangjiangtao.reflect.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Director {

    public void direct() {
        ApplicationContext context = new ClassPathXmlApplicationContext("application.XML");//加载配置文件
        MoAttack moAttack = (MoAttack) context.getBean("moAttack");//获取moAttack bean
        moAttack.cityGateAsk();//调用cityGateAsk方法
    }

    public static void main(String[] args) {
        Director director = new Director();
        director.direct();
    }
}
